package socks5http

import (
	"io"
	"net/http"
	"net/url"
	"sieve_admin_server_userpass/lib/net/socks5"
)

func NewClient(proxy *socks5.Proxy) *http.Client {
	return &http.Client{Transport: &http.Transport{DialContext: proxy.DialContext}}
}

func Get(proxy *socks5.Proxy, url string) (resp *http.Response, err error) {
	return NewClient(proxy).Get(url)
}

func Post(proxy *socks5.Proxy, url string, contentType string, body io.Reader) (resp *http.Response, err error) {
	return NewClient(proxy).Post(url, contentType, body)
}

func PostForm(proxy *socks5.Proxy, url string, data url.Values) (resp *http.Response, err error) {
	return NewClient(proxy).PostForm(url, data)
}
